package cn.dengta.webapp.user.model;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.common.model.ValueProxyImpl;
import lombok.Getter;

/**
 * 状态描述符
 */
@Getter
public enum ActivityStatusDescriptor implements ValueProxyImpl<ActivityStatusDescriptor, Integer> {
	/** 已结束 */
	CLOSE(-1, "已结束", false),
	/** 即将开始 */
	WAIT_OPEN(0, "即将开始", false),
	/** 进行中 */
	OPEN(1, "进行中", true),
	//
	;

	private final Integer value;
	private final String label;
	private final boolean canJoin;
	final ValueProxy<ActivityStatusDescriptor, Integer> proxy;

	ActivityStatusDescriptor(Integer value, String label, boolean canJoin) {
		this.value = value;
		this.label = label;
		this.canJoin = canJoin;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	public static ActivityStatusDescriptor of(Integer value) {
		return WAIT_OPEN.getValueOf(value);
	}

}
